let uu=document.querySelector('.producte_ul');
let el="";
fetch("http://chst.vip:1234/api/getmoneyctrl")
.then(body=>body.json())
.then(res=>{
    console.log(res)
    res.result.forEach(item=>{
        let regExp = /(?<=imgurl=)[^'"]*/;
        let r=item.productImg2.match(regExp);
        el+=`
    <li productid="${item.productId}">
        <a productid="${item.productId}">            
            <div class="img fl" productid="${item.productId}">
                <img height="100" width:"100" src="${r[0]}" alt="" productid="${item.productId}">
            </div>            
            <div class="infoR" productid="${item.productId}">                
                <div class="title" productid="${item.productId}">
                    <h4 productid="${item.productId}">${item.productName}
                        <span>${item.productPinkage}</span>
                    </h4>
                </div>                
                <div class="other" productid="${item.productId}">
                    <span class="mall fl">${item.productFrom}|${item.productTime}<span>
                    <em class="fr" productid="${item.productId}">
                    <span productid="${item.productId}">${item.productComCount}</span>
                    <img width="16" height="16" src="./assets/images/对话信息.png" alt="" productid="${item.productId}">
                        
                    </em>   
                </div>   
            </div>
        </a>
    </li>`
    })
    uu.innerHTML=el;
})

 uu.onclick=function(e){
    if(e.target.localName='li'){
        let _this=e.target;
        let id=_this.getAttribute('productid');
        console.log(id)
        location.href="./../pages/producte_detail.html?productid="+id;
    }
} 